package org.learn.java;

public class CoupanCollector {

	public static void main(String[] args) {
		int N = Integer.parseInt(args[0]);

		boolean[] b = new boolean[N];
		int valCnt = 0;
		int trials = 0;

		while (valCnt < N) {
			int val = (int) (Math.random() * N);
			if (!b[val]) {
				b[val] = true;
				valCnt++;
			}
			++trials;
		}
		
		System.out.println("Number of Trials: " + trials);

	}
}
